package com.vim.modules.web.model;

import com.vim.common.ShopConstants;
import com.vim.common.model.base.BaseEntity;
import com.vim.common.utils.NumberTool;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

public class ShopOrder extends BaseEntity{
 
	/**订单ID*/
	private String orderId;

	/**订单编号*/
	private String orderSn;

	/**第三方支付单号*/
	private String outerSn;

	/**购买者ID*/
	private String buyerId;

	/**购买者名称*/
	private String buyerName;

	/**购买平台: 0PC  1安卓  2IOS  3微信*/
	private Integer buyerPlatform;

	/**购买方式: 0余额  1微信  2支付宝*/
	private String payMode;

	/**支付时间*/
	private Date payTime;

	/**支付留言*/
	private String payMsg;

	/**支付状态: 0未付款  1已付款*/
	private Integer payStatus;

	/**订单状态: 0:已取消;  10:待付款;  20:待发货;  30:待收货;  40:交易完成*/
	private Integer orderState;

	/**订单状态页面展示*/
	private String orderStateStr;

	/**订单总金额*/
	private BigDecimal orderTotalPrice;

	/**订单总金额页面展示*/
	private String orderTotalPriceStr;

	/**订单支付金额*/
	private BigDecimal orderPayPrice;

	/**订单支付金额页面展示*/
	private String orderPayPriceStr;

	/**运费价格页面展示*/
	private BigDecimal orderFreightPrice;

	/**运费价格*/
	private String orderFreightPriceStr;

	/**联系方式*/
	private String orderPhone;

	/**收货地址*/
	private String orderAddress;

	/**订单创建时间*/
	private Date createTime;

	/**订单商品列表*/
	private List<ShopOrderGoods> orderGoodsList;

	public String getOrderId(){
		return orderId;
	}

	public void setOrderId(String orderId){
		this.orderId = orderId;
	}

	public String getOrderSn(){
		return orderSn;
	}

	public void setOrderSn(String orderSn){
		this.orderSn = orderSn;
	}

	public String getOuterSn(){
		return outerSn;
	}

	public void setOuterSn(String outerSn){
		this.outerSn = outerSn;
	}

	public String getBuyerId(){
		return buyerId;
	}

	public void setBuyerId(String buyerId){
		this.buyerId = buyerId;
	}

	public String getBuyerName(){
		return buyerName;
	}

	public void setBuyerName(String buyerName){
		this.buyerName = buyerName;
	}

	public Integer getBuyerPlatform(){
		return buyerPlatform;
	}

	public void setBuyerPlatform(Integer buyerPlatform){
		this.buyerPlatform = buyerPlatform;
	}

	public String getPayMode(){
		return payMode;
	}

	public void setPayMode(String payMode){
		this.payMode = payMode;
	}

	public Date getPayTime(){
		return payTime;
	}

	public void setPayTime(Date payTime){
		this.payTime = payTime;
	}

	public String getPayMsg(){
		return payMsg;
	}

	public void setPayMsg(String payMsg){
		this.payMsg = payMsg;
	}

	public Integer getPayStatus(){
		return payStatus;
	}

	public void setPayStatus(Integer payStatus){
		this.payStatus = payStatus;
	}

	public Integer getOrderState(){
		return orderState;
	}

	public void setOrderState(Integer orderState){
		this.orderState = orderState;
	}

	public String getOrderStateStr() {
		if(null != orderState){
			if(orderState == ShopConstants.ORDER_STATE.ORDER_STATE_CANCEL){
				return "已取消";
			}else if(orderState == ShopConstants.ORDER_STATE.ORDER_STATE_WAITING_PAY){
				return "待付款";
			}else if(orderState == ShopConstants.ORDER_STATE.ORDER_STATE_WAITING_SEND){
				return "待发货";
			}else if(orderState == ShopConstants.ORDER_STATE.ORDER_STATE_WAITING_RECEIVE){
				return "待收货";
			}else if(orderState == ShopConstants.ORDER_STATE.ORDER_STATE_COMPLETE){
				return "交易完成";
			}
		}
		return "";
	}

	public BigDecimal getOrderTotalPrice(){
		return orderTotalPrice;
	}

	public void setOrderTotalPrice(BigDecimal orderTotalPrice){
		this.orderTotalPrice = orderTotalPrice;
	}

	public BigDecimal getOrderPayPrice(){
		return orderPayPrice;
	}

	public void setOrderPayPrice(BigDecimal orderPayPrice){
		this.orderPayPrice = orderPayPrice;
	}

	public BigDecimal getOrderFreightPrice(){
		return orderFreightPrice;
	}

	public void setOrderFreightPrice(BigDecimal orderFreightPrice){
		this.orderFreightPrice = orderFreightPrice;
	}

	public String getOrderTotalPriceStr() {
		if(null != orderTotalPrice){
			return NumberTool.formatToNumber(orderTotalPrice);
		}else{
			return NumberTool.formatToNumber(BigDecimal.ZERO);
		}
	}

	public String getOrderPayPriceStr() {
		if(null != orderPayPrice){
			return NumberTool.formatToNumber(orderPayPrice);
		}else{
			return NumberTool.formatToNumber(BigDecimal.ZERO);
		}
	}

	public String getOrderFreightPriceStr() {
		if(null != orderFreightPrice){
			return NumberTool.formatToNumber(orderFreightPrice);
		}else{
			return NumberTool.formatToNumber(BigDecimal.ZERO);
		}
	}

	public String getOrderPhone() {
		return orderPhone;
	}

	public void setOrderPhone(String orderPhone) {
		this.orderPhone = orderPhone;
	}

	public String getOrderAddress() {
		return orderAddress;
	}

	public void setOrderAddress(String orderAddress) {
		this.orderAddress = orderAddress;
	}

	public Date getCreateTime(){
		return createTime;
	}

	public void setCreateTime(Date createTime){
		this.createTime = createTime;
	}

	public List<ShopOrderGoods> getOrderGoodsList() {
		return orderGoodsList;
	}

	public void setOrderGoodsList(List<ShopOrderGoods> orderGoodsList) {
		this.orderGoodsList = orderGoodsList;
	}
}

